<template>
  <v-command :name="command">
    <v-icon :type="iconType"></v-icon>
  </v-command>
</template>

<script>
import { Command } from 'vg-editor';
import Icon from '../Icon/index';

export default {
  name: 'ToolbarButton',

  props: ['command', 'icon', 'text'],

  computed: {
    iconType () {
      return `icon-${this.icon || this.command}`;
    }
  },

  components: {
    vCommand: Command,
    vIcon: Icon
  }
};
</script>
